﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!-- Button -->
    <!--<Style TargetType="Button" x:Key="CmdButton">
        <Setter Property="Background" Value="#54d35A"/>
        <Setter Property="Foreground" Value="Black"/>
    </Style>
    -->

    <!--<LinearGradientBrush x:Key="BackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FF6FBDE8" Offset="0"/>
                <GradientStop Color="#FF4385BE" Offset="1"/>
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>-->

    <!--<SolidColorBrush x:Key="BackgroundBrush" Color="#EAEAEA"></SolidColorBrush>-->

    <SolidColorBrush x:Key="BackgroundBrush" Color="#FF6FBDE8"></SolidColorBrush>
    
    <Style TargetType="Button" x:Key="CmdButtonTransparent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <StackPanel Width="{TemplateBinding Width}" Height="{TemplateBinding Width}" x:Name="panel">
                        <ContentPresenter Width="{TemplateBinding Width}" Height="{TemplateBinding Width}" />
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="MyFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Control}">
                    <Grid Margin="3 2">
                        <Rectangle Name="r1" StrokeThickness="1" Stroke="Black" StrokeDashArray="2 2"/>
                        <Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"  CornerRadius="2" BorderThickness="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ShadowStyle">
        <Setter Property="Control.Foreground" Value="LightGray" />
    </Style>

    <Style x:Key="CmdButton" TargetType="Button">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Margin" Value="2"/>
        <Setter Property="FontFamily" Value="Verdana"/>
        <Setter Property="FontSize" Value="11px"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}" />
        <Setter Property="Background" Value="{StaticResource BackgroundBrush}">
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border Name="border" 
				BorderThickness="0"
				Padding="4,2" 
				BorderBrush="DarkGray" 
				CornerRadius="3" 
				Background="{TemplateBinding Background}">
                        <Grid >
                            <ContentPresenter HorizontalAlignment="Center" 
	                           VerticalAlignment="Center" Name="contentShadow" 
					Style="{StaticResource ShadowStyle}">
                                <ContentPresenter.RenderTransform>
                                    <TranslateTransform X="1.0" Y="1.0" />
                                </ContentPresenter.RenderTransform>
                            </ContentPresenter>
                            <ContentPresenter HorizontalAlignment="Center" 
                            VerticalAlignment="Center" Name="content"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="Green" />
                            <Setter TargetName="border" Property="BorderThickness" Value="1" />
                            <Setter Property="Foreground" Value="White" />
                            <Setter Property="Background" Value="#54d35A" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background" >
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                                        <GradientStop Color="Green" Offset="0.35"/>
                                        <GradientStop Color="#54d35A" Offset="0.95"/>
                                        <GradientStop Color="Green" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="border" Property="BorderThickness" Value="1" />
                            <Setter TargetName="content" Property="RenderTransform" >
                                <Setter.Value>
                                    <TranslateTransform Y="1.0" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="border" Property="Opacity" Value="0.9" />
                            <Setter Property="Foreground" Value="Gray" />
                            <Setter TargetName="content" Property="Opacity" Value="0.2" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!-- End Button -->
    
    <DataTemplate x:Key="coverPreview">
        <WrapPanel ScrollViewer.HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Left" VerticalAlignment="Top" >
            <TextBlock Text="{Binding Path=URI}">
                <TextBlock.ToolTip>
                     <Image Source="{Binding Path=URI}" Width="100" Height="100" Margin="10"></Image>
                </TextBlock.ToolTip>
            </TextBlock>
        </WrapPanel>
    </DataTemplate>

    <!--- CoverView -->

    <DataTemplate x:Key="coverCell">
        <StackPanel Orientation="Horizontal">
            <Image Source="{Binding Path=URI}" Width="50" Height="50" Margin="0"></Image>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="checkboxCell">
        <StackPanel Orientation="Horizontal">
            <CheckBox Name="chk1" IsChecked="{Binding Path=IsSelected}"/>
        </StackPanel>
    </DataTemplate>

    <!--FolderList -->
      
    <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="ScrollViewer">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <DockPanel Margin="{TemplateBinding Padding}">
                            <ScrollViewer DockPanel.Dock="Top" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Focusable="false">
                                <GridViewHeaderRowPresenter Margin="0,0,0,0" Columns="{Binding Path=TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}" 
                                                            ColumnHeaderContainerStyle="{Binding Path=TemplatedParent.View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}"                                
                                                            ColumnHeaderTemplate="{Binding Path=TemplatedParent.View.ColumnHeaderTemplate,RelativeSource={RelativeSource TemplatedParent}}"   
                                                            ColumnHeaderTemplateSelector="{Binding Path=TemplatedParent.View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"  
                                                            AllowsColumnReorder="{Binding Path=TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}"  
                                                            ColumnHeaderContextMenu="{Binding Path=TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}"           
                                                            ColumnHeaderToolTip="{Binding Path=TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}" 
                                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </ScrollViewer>
                            <ScrollContentPresenter Name="PART_ScrollContentPresenter" KeyboardNavigation.DirectionalNavigation="Local" CanContentScroll="True" CanHorizontallyScroll="False" CanVerticallyScroll="False"/>
                        </DockPanel>
                        <ScrollBar Name="PART_HorizontalScrollBar" Orientation="Horizontal" Grid.Row="1" Maximum="{TemplateBinding ScrollableWidth}" ViewportSize="{TemplateBinding ViewportWidth}" Value="{TemplateBinding HorizontalOffset}" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                        <ScrollBar Name="PART_VerticalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" ViewportSize="{TemplateBinding ViewportHeight}" Value="{TemplateBinding VerticalOffset}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="{x:Type ListView}" TargetType="ListView">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListView">
                    <Border Name="Border" BorderThickness="1" BorderBrush="#999999" Background="#DFDFDF">
                        <ScrollViewer Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}">
                            <ItemsPresenter />
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="#BBBBBB"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <LinearGradientBrush x:Key="HighlightBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FF97d3f3" Offset="0"/>
                <GradientStop Color="#FF4385BE" Offset="1"/>
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="BorderBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFAFDDF6" Offset="0"/>
                <GradientStop Color="#FF2969AA" Offset="1"/>
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FF75aac7" Offset="0"/>
                <GradientStop Color="#FF143c65" Offset="1"/>
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>


    <Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
        <Setter Property="Width" Value="14"/>
        <Setter Property="Background" Value="#2e566b"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                        <Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="{x:Type GridViewColumnHeader}" TargetType="GridViewColumnHeader">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="#FFFFFF" />
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewColumnHeader">
                    <Grid>
                        <Border Name="HeaderBorder" Padding="{TemplateBinding Padding}" BorderThickness="0,1,0,1" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource BackgroundBrush}">
                            <ContentPresenter Name="HeaderContent" Margin="0,0,0,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                        <Thumb x:Name="PART_HeaderGripper" HorizontalAlignment="Right" Margin="0,0,-9,0" Style="{StaticResource GridViewColumnHeaderGripper}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource HighlightBackgroundBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource PressedBorderBrush}"/>
                            <Setter TargetName="HeaderContent" Property="Margin" Value="1,1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Role" Value="Floating">
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Canvas Name="PART_FloatingHeaderCanvas">
                                <Rectangle Fill="#60000000" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"/>
                            </Canvas>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Border Name="HeaderBorder" BorderThickness="0,1,0,1" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource BackgroundBrush}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <DataTemplate x:Key="ArtistCell">
        <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
            <TextBlock Text="{Binding Artist}" VerticalAlignment="Center" Grid.Column="1" >
                <TextBlock.ToolTip>
                    <StackPanel>
                        <Image Source="{Binding Path=ImageBitmap}" Width="70" Height="70"></Image>
                    </StackPanel>
                </TextBlock.ToolTip>
            </TextBlock>
        </Border>
    </DataTemplate>
    <DataTemplate x:Key="TitleCell">
        <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
            <TextBlock Text="{Binding Title}" VerticalAlignment="Center" Grid.Column="1">
                <TextBlock.ToolTip>
                    <Image Source="{Binding Path=ImageBitmap}" Width="70" Height="70"></Image>
                </TextBlock.ToolTip>
            </TextBlock>
        </Border>
    </DataTemplate>
    <DataTemplate x:Key="AlbumCell">
        <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
            <TextBlock Text="{Binding AlbumName}" VerticalAlignment="Center" Grid.Column="1" >
                 <TextBlock.ToolTip>
                    <Image Source="{Binding Path=ImageBitmap}" Width="70" Height="70"></Image>
                </TextBlock.ToolTip>
            </TextBlock>
        </Border>
    </DataTemplate>
    <DataTemplate x:Key="GenreCell">
        <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
            <TextBlock Text="{Binding Genre}" VerticalAlignment="Center" Grid.Column="1" >
                 <TextBlock.ToolTip>
                    <Image Source="{Binding Path=ImageBitmap}" Width="70" Height="70"></Image>
                </TextBlock.ToolTip>
            </TextBlock>
        </Border>
    </DataTemplate>
    <DataTemplate x:Key="FileNameCell">
        <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
            <TextBlock Text="{Binding FileName}" VerticalAlignment="Center" Grid.Column="1" >
                 <TextBlock.ToolTip>
                    <Image Source="{Binding Path=ImageBitmap}" Width="70" Height="70"></Image>
                </TextBlock.ToolTip>
            </TextBlock>
        </Border>
    </DataTemplate>
    
    <DataTemplate x:Key="hasCoverCell">
        <Grid>
            <Image x:Name="img" Source="/Shoozla;component/Images/cancel.png" Width="15" Height="15" HorizontalAlignment="Center"/>            
        </Grid>
        <DataTemplate.Triggers>
                            <DataTrigger Binding="{Binding Path=HasCover, Mode=OneWay}" Value="True">                                                                        
                                    <Setter TargetName="img" Property="Source" Value="/Shoozla;component/Images/tick.png"/>                                            
                            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    
    <!--FolderList END -->
</ResourceDictionary>